package com.gitee.wsl.ext.number

import com.gitee.wsl.mathematics.vector.vec2.Vector2
import com.gitee.wsl.mathematics.vector.vec3.Vector3
import com.gitee.wsl.mathematics.vector.vec4.Vector4

fun Number.saturate() = saturate(this.toDouble())

fun <T:Number,V: Vector2<T, V>> V.saturate() = create(x.saturate()+zero, y.saturate()+zero)
fun <T:Number,V: Vector3<T, V>> V.saturate() = create(x.saturate()+zero, y.saturate()+zero, z.saturate()+zero)
fun <T:Number,V: Vector4<T, V>> V.saturate() = create(x.saturate()+zero, y.saturate()+zero, z.saturate()+zero, w.saturate()+zero)
